/*
 * Expression.h
 *
 *  Created on: 25.03.2014
 *      Author: Nicolas Winkler
 */

#ifndef _SOLVER_EXPRESSION_H
#define _SOLVER_EXPRESSION_H

#include <vector>
#include <string>

#include "Parser.h"
#include "Definitions.h"
#include "BigInteger.h"

namespace solver
{
	class Expression;

	class IntegerExpression;
}


class solver::Expression
{
public:
	Expression(void);
	virtual ~Expression(void);

	virtual const Expression* evaluate(void) const = 0;
	virtual std::string getAsString(void) const = 0;

	virtual std::string toString(void) const = 0;

	virtual const Expression* add(const Expression* b) const;
	virtual const Expression* sub(const Expression* b) const;
	virtual const Expression* mult(const Expression* b) const;
	virtual const Expression* div(const Expression* b) const;
	virtual const Expression* pow(const Expression* b) const;
};


class solver::IntegerExpression :
		public Expression
{
public:
	math::BigInteger value;

	IntegerExpression(const math::BigInteger& value);
	virtual ~IntegerExpression(void);

	virtual const Expression* evaluate(void) const;
	virtual std::string getAsString(void) const;
	virtual std::string toString(void) const;

	virtual const Expression* add(const Expression* b) const;
	virtual const Expression* sub(const Expression* b) const;
	virtual const Expression* mult(const Expression* b) const;
	virtual const Expression* div(const Expression* b) const;
	virtual const Expression* pow(const Expression* b) const;
};


#endif // _SOLVER_EXPRESSION_H
